﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using HalconDisplayControl.Attributes;
using HalconDotNet;

namespace HalconDisplayControl.Shape
{
    public class LineShape : IShape
    {
        [ParamName("row1")]
        public double StartRow { get; set; }= 100;
        [ParamName("column1")]
        public double StartColumn { get; set; } = 50;
        [ParamName("row2")]
        public double EndRow { get; set; } = 150;
        [ParamName("column2")]
        public double EndColumn { get; set; } = 250;

        public void CreateDrawingObj(out HTuple drawId)
        {
            HOperatorSet.CreateDrawingObjectLine(StartRow, StartColumn, EndRow, EndColumn, out drawId);
        }

        public void CreateShapeObj(out HObject shapeObj)
        {
            HOperatorSet.GenRegionLine(out shapeObj, StartRow, StartColumn, EndRow, EndColumn);
        }
    }
}
